<?php
class bd
{
	/*
	protected $_host = "mysql51.amplitudeweb.com.br"; 
	protected $_user = "amplitudeweb50";
	protected $_pass = "raimundos25";
	protected $_base = "amplitudeweb50";
	*/
	
	
	protected $_host = "localhost"; 
	protected $_user = "eurogync_user";
	protected $_pass = "T[1m[9Z,Nw&g";
	protected $_base = "eurogync_bd"; 
	 
	public function conecta()
	{
		//header('Content-Type: text/html; charset=utf-8');
		mysql_connect($this->_host,$this->_user,$this->_pass) or die (mysql_error());
		mysql_select_db($this->_base) or die (mysql_error());
		mysql_query("SET NAMES 'utf8'");
		mysql_query('SET character_set_connection=utf8');
		mysql_query('SET character_set_client=utf8');
		mysql_query('SET character_set_results=utf8');

	}
	public function desconecta()
	{
		mysql_close();
	}
	public function exeQuery($strQuery)
	{
		$this->conecta();
		$dbResult = mysql_query($strQuery) or die (mysql_error());
		$id_insert = mysql_insert_id();
		$this->desconecta();
		if (!empty($id_insert))
			return $id_insert;
		else
			return $dbResult;			
	}

} 
?>